<section class="scrollable padder-md" data-ng-controller="BillListController">
    <div class="m-b-md">
        <h3 class="m-b-none text-black">
            <i class="fa fa-list m-r-sm"></i>账单
        </h3>
    </div>
    <!-- Toolbar 按钮栏 -->
    <section class="panel panel-default scrollable">
        <header class="panel-heading">
            <div class="row">
                <div class="col-sm-5">
                    <div class="od-head-title">账单列表</div>
                </div>
            </div>
        </header>
        <form class="form-inline" data-ng-submit="getObjList()">
            <div class="wrapper row">
                <div class="col-sm-10">
                    <div class="form-group">
                        <input type="text"
                               class="input-sm form-control"
                               data-ng-model="queryObj.userName" placeholder="司机姓名">
                    </div>
                    <div class="form-group">
                        <input data-ng-model="queryObj.startTime" class="input-sm form-control" type="text"
                               data-jss-datetimepicker="yyyy-mm-dd hh:ii" placeholder="开始时间"/>
                    </div>
                    <div class="form-group">
                        <input data-ng-model="queryObj.endTime" class="input-sm form-control" type="text"
                               data-jss-datetimepicker="yyyy-mm-dd hh:ii" placeholder="结束时间"/>
                    </div>
                    <div class="form-group">
                        <button class="form-control btn btn-sm btn-warning " type="submit">查询</button>
                    </div>
                </div>
                <div class="col-sm-2 text-right">
                    <div class="form-group">
                        <button class="form-control btn btn-sm btn-success " type="button"
                                data-ng-click="createBill()">生成账单
                        </button>
                    </div>
                </div>
            </div>
        </form>
        <!-- 表格部分 -->
        <div class="table-responsive">
            <table class="table table-striped b-t b-light">
                <thead>
                <tr>
                    <th>序号</th>
                    <th>账单名</th>
                    <th>金额</th>
                    <th>结算周期</th>
                    <th>结算支付时间</th>
                    <th>状态</th>
                    <th class="col-md-3">操作</th>
                </tr>
                </thead>
                <tbody>
                <tr data-ng-repeat="bill in billList">
                    <td>{{(pagerObj.currentPage-1)*pagerObj.pageSize+$index+1}}</td>
                    <td>{{bill.name}}</td>
                    <td>{{bill.amount}}</td>
                    <td>
                        {{bill.settlementStartTime|date:"yyyy-MM-dd HH:mm:ss"}} - {{bill.settlementEndTime|date:"yyyy-MM-dd HH:mm:ss"}}
                    </td>
                    <td>{{bill.payTime|date:"yyyy-MM-dd HH:mm:ss"}}</td>
                    <td>
                        <span data-ng-if="bill.state == 0" class="badge bg-primary">已创建</span>
                        <span data-ng-if="bill.state == 50" class="badge bg-success">已结算</span>
                    </td>
                    <td>
                        <a href="javascript:void(0);" class="text-primary m-r-xs" data-ng-click="edit(bill.id)"><i
                                class="fa fa-edit"></i>编辑</a>
                        <a href="javascript:void(0);" class="text-danger m-r-xs" data-ng-click="pay(bill)"
                           data-ng-if="bill.state < 50"><i class="fa fa-money"></i>结算</a>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>

        <!-- 分页控件 -->
        <footer class="panel-footer">
            <div data-ng-include="'comm/pager/pager.html'"></div>
        </footer>
    </section>
</section>
